package com.jing.taobao.service.spread;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.jing.taobao.mapper.spread.TbSpreadTypeMapper;
import com.jing.taobao.pojo.spread.TbSpreadType;
import com.jing.weibo.pojo.pb.PbType;

/**
 * 淘宝推广类型的Service
 * @author jing.yue
 * @version 2012/10/30 1.0.0
 */
@Component
public class TbSpreadTypeService {

	@Autowired
	private TbSpreadTypeMapper tbSpreadTypeMapper;

	/**
	 * 获取所有一级分类推广类型列表
	 * @return
	 * @throws Exception
	 */
	public List<TbSpreadType> findAllParentTbSpreadType() throws Exception {
		return tbSpreadTypeMapper.findAllParentTbSpreadType();
	}

	/**
	 * 获取所有推广类型列表
	 * @return
	 * @throws Exception
	 */
	public List<TbSpreadType> findAllTbSpreadType() throws Exception {
		return tbSpreadTypeMapper.findAllTbSpreadType();
	}

	/**
	 * 根据PID获取集合
	 * @param pid
	 * @return
	 * @throws Exception
	 */
	public List<PbType> findByPidTbSpreadType(Integer pid) throws Exception {
		return tbSpreadTypeMapper.findByPidTbSpreadType(pid);
	}
}